import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import icons from 'unplugin-icons/vite'
import IconsResolver from 'unplugin-icons/resolver'
import ElementPlus from 'unplugin-element-plus/vite'
import {ElementPlusResolver} from "unplugin-vue-components/resolvers";

// https://vitejs.dev/config/
export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "element-plus/theme-chalk/src/index.scss" as *;`,
      },
    },
  },
  plugins: [
      vue(),
      AutoImport({
          imports: ['vue'],
          resolvers: [
            ElementPlusResolver(),
            IconsResolver({
                prefix:'Icon'
            })
            ],
      }),
      Components({
        resolvers: [ElementPlusResolver(),
                IconsResolver({
                    enabledCollections: ['ep']
                })
        ] ,
      }),
      icons({
          autoInstall: true
      }),
      ElementPlus({
          useSass: true
      })
  ],
})
